Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Using Standard Image-Compression Dialog Components

You can use the standard image-compression dialog component to obtain image or image sequence compression parameters from the user and to manage the process of compressing the image or sequence. This component presents a consistent interface to the user and eliminates the need for you to worry about the details of managing this dialog box. Once you have collected the parameter information from the user, you can use the component to instruct the Image Compression Manager to perform the image or sequence compression. Again, the component manages the details for you.

Because the standard image-compression dialog component is a component, you use the Component Manager to open and close your connection. If you are unfamiliar with components or the Component Manager, see the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox .

Before you can open a connection to a standard image-compression dialog component, be sure that the Component Manager, Image Compression Manager, and 32-bit Color QuickDraw are available. You can use the Gestalt Manager to determine if these facilities are available. For more information about the Gestalt Manager, see the chapter "Gestalt Manager" in Inside Macintosh: Operating System Utilities . For details on 32-bit Color QuickDraw, see the chapter "Color QuickDraw" in Inside Macintosh: Imaging .

Once you have established a connection to a standard image-compression dialog component, your application can present the dialog box to the user. The user selects the desired compression parameters and clicks the OK button. The component then stores these parameters for your application, using them, when appropriate, to work with the Image Compression Manager to compress the image or sequence. Figure 1 shows one of the dialog boxes that is supported by the standard image-compression dialog component provided by Apple.

Every standard image-compression dialog box has its own set of parameter information. This information identifies the compressor component to be used, determines which dialog box is used, and specifies the parameters to be used during the compression operation. This information is stored by the component. You can use functions provided by the component to examine or modify these parameters.

The standard image-compression dialog component provided by Apple allows you to augment or extend the interface provided by its dialog boxes. This component supports a single custom button. Your application enables this button when it instructs the component to display the dialog box to the user. You provide the code that supports this button in a hook function in your application. In addition, this component allows you to define a filter function--you can use this function to process dialog box events before the component. Figure 3 identifies the parts of the dialog box supported by Apple's standard dialog component.

Figure 3 Elements of the standard image-compression dialog box

The following sections provide more detailed information about using the standard image-compression dialog component.

Opening a Connection to a Standard Image-Compression Dialog Component

Displaying the Dialog Box to the User

Extending the Basic Dialog Box


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next